package com.cweb.admin.model.sys.sys_oss_record.controller;

import com.cweb.admin.model.sys.sys_oss_record.service.SysOssRecordService;
import com.cweb.framework.annotation.Remark;
import com.cweb.framework.base.controller.BaseController;
import com.cweb.framework.pojo.BaseResponse;
import com.cweb.framework.pojo.CustomException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 系统-oss上传记录 前端控制器
 * </p>
 *
 * @author changfan
 * @since 2019-10-28
 */
@Controller
@RequestMapping("sys/oss")
public class SysOssRecordController extends BaseController {
    @Autowired
    private SysOssRecordService sysOssRecordService;

    @ResponseBody
    @RequestMapping("uploadTempFile")
    @Remark(name = "文件上传临时空间", describe = "")
    public BaseResponse uploadTempFile(@RequestParam("file") MultipartFile multipartFile) throws CustomException {
        return new BaseResponse(sysOssRecordService.uploadTempFile(multipartFile));
    }

//    @ResponseBody
//    @RequestMapping("copyFile")
//    @Remark(name = "已生上传文件复制", describe = "")
//    public BaseResponse copyFile(SysOssRecord sysOssRecord) throws CustomException {
//        return new BaseResponse(sysOssRecordService.copyFile("call_business", sysOssRecord.getId(), "ytt-call-business"));
//    }
}

